package com.mcxx.modules.nopage.service.read;

import com.mcxx.modules.base.utils.QueryParamUtil;
import com.mcxx.modules.miniSalvation.order.dao.read.OrderReadDao;
import com.mcxx.modules.miniSalvation.order.dto.OrderListDTO;
import com.mcxx.modules.nopage.dao.read.DocNoPageReadDao;
import com.mcxx.modules.nopage.dto.EFileRecordInfoDTO;
import com.mcxx.modules.nopage.entity.DNPAcceptanceNoticeEntity;
import com.mcxx.modules.nopage.entity.DocNoPageRecordEntity;
import com.mcxx.modules.nopage.entity.DocNoPageTemplateEntity;
import com.mcxx.modules.nopage.entity.StopEnsureEntity;
import com.mcxx.modules.nopage.entity.vo.StopEnsureQueryVO;
import com.mcxx.modules.nopage.param.EFileRecordInfoParam;
import com.mcxx.modules.nopage.param.EFileTemplateInfoParam;
import com.mcxx.util.DateUtil;
import com.yinhai.ta404.core.restservice.requestbean.PageParam;
import com.yinhai.ta404.core.restservice.resultbean.Page;
import com.yinhai.ta404.core.security.vo.UserAccountVo;
import com.yinhai.ta404.core.service.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class DocNoPageReadService extends BaseService {

    @Autowired
    private DocNoPageReadDao docNoPageReadDao;

    public DocNoPageTemplateEntity getDocTemplate(DocNoPageTemplateEntity entity) {
        return docNoPageReadDao.getDocTemplate(entity);
    }

    public DocNoPageRecordEntity getDocLowIncomeRecord(DocNoPageRecordEntity entity) {
        return docNoPageReadDao.getDocNoPageRecord(entity);
    }

    public Page getEFileRecordInfo(EFileRecordInfoParam param, PageParam pageParam) {
        docNoPageReadDao.beginPager(pageParam);
        param.setNowTime(DateUtil.date2Str(DateUtil.sdf));
        return docNoPageReadDao.endPager(docNoPageReadDao.getEFileRecordInfo(param));
    }

    public Page getDocTemplateList(EFileTemplateInfoParam param, PageParam pageParam) {
        docNoPageReadDao.beginPager(pageParam);
        return docNoPageReadDao.endPager(docNoPageReadDao.getDocTemplateList(param));
    }

    public DocNoPageTemplateEntity getDocTemplateInfo(EFileTemplateInfoParam entity) {
        return docNoPageReadDao.getDocTemplateInfo(entity);
    }


    public DNPAcceptanceNoticeEntity getAcceptanceNotice(String orderId){
        return docNoPageReadDao.selectAcceptanceNotice(orderId);
    }


    public Page getStopEnsureList(StopEnsureQueryVO param,PageParam pageParam, UserAccountVo accountVo){


        QueryParamUtil.setBaseParamValue(param,accountVo);


        docNoPageReadDao.beginPager(pageParam);
        List<StopEnsureEntity> list = docNoPageReadDao.selectStopEnsureList(param);

        return docNoPageReadDao.endPager(list);
    }
}
